<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Lowin</title>
<link rel="stylesheet" href="css/auth.css">
<link rel="stylesheet" type="text/css" href="themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="themes/icon.css">
<script type="text/javascript" src="js/jquery.min.js">
</script>
<script type="text/javascript" src="js/jquery.easyui.min.js">
</script>

<script type="text/javascript">
	$(function(){
		//校验密码修改
				//不能为空校验  两次密码验证
		$("#up").submit(function(){
			if($("#pwd1").val()==""){//校验新密码
				alert("新密码不能为空");
				return false;
			}else if($("#pwd2").val()==""){//校验确认密码
				alert("确认密码不能为空");
				return false;
			}else if($("#pwd1").val()!=$("#pwd2").val()){//校验新密码和确认密码是否一致
				alert("两次密码 不一致");
				return false;
			}else if ("#name"=="") {
				alert("请输入用户名");
				return false;
			}else{
				return true;
			}
		})
	})

</script>

</head>

<body>
	<div class="lowin">
		<div class="lowin-brand">
			<img src="img/kodinger.jpg" alt="logo">
		</div>
		<div class="lowin-wrapper">
			<div class="lowin-box lowin-login">
				<!-- 登陆界面 -->
				<div class="lowin-box-inner">
					<form method="post">
						<input type="hidden" name="oper" value="login" />
						<p>Sign in to continue</p>
						<p>
							<!-- 使用jstl和EL表达式完成提示语 -->
							<c:choose>
								<c:when test="${flag==0}">
									<div style="text-align: center;">
										<span
											style="font-size: 20px; color: darkerd; font-weight: bold">用户名或密码错误！</span>
									</div>
								</c:when>
								<c:when test="${flag==1}">
									<div style="text-align: center;">
										<span
											style="font-size: 20px; color: darkerd; font-weight: bold">密码修改成功！</span>
									</div>
								</c:when>
								<c:when test="${flag==2}">
									<div style="text-align: center;">
										<span
											style="font-size: 20px; color: darkerd; font-weight: bold">注册成功！</span>
									</div>
								</c:when>
							</c:choose>
							<c:remove var="flag" scope="session" />
						</p>
						<div class="lowin-group">
							<label>Username <a href="#" class="login-back-link">Sign
									in?</a></label> <input type="text" autocomplete="uname" name="uname"
								class="lowin-input">
						</div>
						<div class="lowin-group password-group">
							<label>Password <a href="#" class="forgot-link">Forgot
									Password?</a></label> <input type="password" name="pwd"
								autocomplete="current-password" class="lowin-input">
						</div>

						<input name="" type="submit" class="lowin-btn" value="login in" />



						<div class="text-foot">
							Don't have an account? <a href="" class="register-link">Register</a>
						</div>
					</form>
				</div>
			</div>

			<div class="lowin-box lowin-register">
				<!-- 注册界面 -->
				<div class="lowin-box-inner">
					<form method="post" action="user" id="up">
						<input type="hidden" name="oper" value="reg" />
						<p>Let's create your account</p>
						<div class="lowin-group">
							<label>Name</label> <input type="text" name="uname" id="name"
								autocomplete="name" class="lowin-input">
						</div>
						<div class="lowin-group">
							<label>Password</label> 
							<span>密码(6-20位只能包含字母、数字、下划线)<label style="color: red;">*</label> <font id="passwordMSG"></font></span> 
							<input type="password" autocomplete="name" name="pwd" class="lowin-input" id="pwd1">
						</div>
						<div class="lowin-group">
							<label>Password</label> 
							<input type="text" name="pwd2" autocomplete="current-password" class="lowin-input" id="pwd2">
						</div>
						<div class="lowin-group">
							<label>Sex</label> 
							男: <input type="radio" name="sex" value="1" checked="checked" /> 
							女: <input type="radio" name="sex" value="0" />
						</div>
						<div class="lowin-group">
							<label>Age</label> 
							<input type="text" name="age" autocomplete="current-password" class="lowin-input">
						</div>
						<div class="lowin-group " >
							<label>Birth</label> 
							<input name="birth" class="lowin-input easyui-datebox " value="" style="height:50px;width:280px;margin-left: 20px;">
							
						</div>
						<input type="submit" name="Sign Up" class="lowin-btn" value="Sign Up">
						<div class="text-foot">
							Already have an account? <a href="" class="login-link">Login</a>
						</div>
					</form>
				</div>
			</div>
		</div>

		<footer class="lowin-footer">
			<!-- 版权注释 -->

		</footer>
	</div>
	
	<%-- 解决iframe退出后局部刷新问题  --%>
	<script language="JavaScript"> 
             if (window != top) 
                       top.location.href = location.href; 
	</script>
	
	<script src="js/auth.js"></script>
	<script>
		Auth.init({
			login_url : 'user',
			forgot_url : 'user'
		});
		$(function(){
		    $('.date').each(function(){
		        $(this).ionDatePicker({
		            lang: 'zh-cn',
		            format: 'YYYY-MM-DD'
		        });
		    });
		});

		
		
	</script>
	
	</style>
	
</body>
</html>